function authentify()
{
	var password = document.getElementById("password").value;
	password = b64_sha1(password);
	document.getElementById("password").value = password;
	document.forms[0].submit();
}

function enterKey(e)
{
     var key;
     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox
     if(key == 13)
     {
          authentify();
     	  return true;
     }
     else
          return true;
}

function init()
{
	document.getElementById("sendButton").onkeypress = enterKey;
	document.getElementById("password").onkeypress = enterKey;
	document.getElementById("sendButton").onclick = authentify;
}

window.onload = init;